#ifndef BALACETREE_H__
#define BALACETREE_H__

typedef char Datatype;

typedef struct tree_st
{
	Datatype data;
	int count;
	struct tree_st *lchild;
	struct tree_st *rchild;
}tree_st;

tree_st *avlCreate();
void avlInsert(tree_st **root,Datatype data);
tree_st *avlFind(tree_st *root,Datatype data);
int avlDepth(tree_st *root);

tree_st *singleLeft(tree_st *root);
tree_st *singleRight(tree_st *root);
tree_st *doubleWithLeftRight(tree_st *root);
tree_st *doubleWithRightLeft(tree_st *root);

void drawTree(tree_st *root);
void avlFirstShow(tree_st *root);
void avlMiddleShow(tree_st *root);
void avlLaterShow(tree_st *root);

#endif
